-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dynamic JS import and add missing scripts for colormaps #193
Conversation
The new commit adds the view change detection section to the |
@blackary The way I hear these issues people are having, it sounds like a race condition to me. For a common dependency like d3, I wonder if we should just add it to the JS component side of the house. Though, I'm not exactly certain the browser behavior if you have a dependency specified, then specify it again dynamically like this package now does |
@Navxihziq Currently the tests are failing from some small type-hint and formatting issues, you please use pre-commit to fix the linting issues, or fix them manually, or allow admins to commit to your branch? |
@blackary Fixed! |
streamlit_folium/__init__.py
Outdated
@@ -5,10 +5,11 @@ | |||
import re | |||
import warnings | |||
from textwrap import dedent | |||
from typing import Iterable | |||
from typing import Iterable, List |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Because of line 1, you can just use list[str]
instead of importing List
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update committed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, and all the tests pass 👍
This PR addresses several issues related to dynamic JavaScript packages imports and the not displayed colormap.
JavaScript package loading order
The script loading mechanism in
index.tsx
has been modified to ensure that JavaScript packages are imported sequentially. This should fix the issues with the vanishing overlay and feature groups caused by dependencies not being loaded in the correct order.Colormap display
The
d3
package, required for displaying thecolormap
, has been manually included. The previous dynamic JS and CSS dependency detection in__init__.py
did not work forbranca.colormap.ColorMap
objects, leading to the colormap not being displayed.With these changes, the dynamic package loading and colormap display issues should be resolved.